import request from "@/utils/request";

const api_url = `/admin/hosp/hospital`;

const api_urlCmn = `/admin/cmn/dict`;

export default {
  //查看医院详情
  getHospById(id) {
    return request({
      url: `/admin/hosp/hospital/showHospDetail/${id}`,
      method: 'get'
    })
  },
  //医院列表
  getHospList(page, limit, searchObj) {
    return request({
      url: `${api_url}/list/${page}/${limit}`,
      method: "get",
      data: searchObj
    });
  },
  //更新医院上线状态
  updateStatus(id,status){
    return request({
      url: `${api_url}/updateStatus/${id}/${status}`,
      method: "get",
    });
  },
  //根据dictCode查询下级数据字典
  findByDictCode(dictCode){
    return request({
      url: `${api_urlCmn}/findByDictCode/${dictCode}`,
      method: "get"
    });
  },
  //根据id查询下级数据字典
  findChildId(dictCode){
    return request({
      url: `${api_urlCmn}/findChildrenData/${dictCode}`,
      method: "get"
    });
  },
  //查看医院科室
  getDeptByHoscode(hoscode) {
    return request({
      url: `/admin/hosp/department/getDeptList/${hoscode}`,
      method: 'get'
    })
  },
  //查看预约规则
  getScheduleRule(page, limit, hoscode, depcode) {
    return request({
      url: `/admin/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`,
      method: 'get'
    })
  },
  //查询排班详情
  getScheduleDetail(hoscode,depcode,workDate){
      return request({
        url:`/admin/hosp/schedule/getScheduleDetail/${hoscode}/${depcode}/${workDate}`,
        method: 'get'
      })
  }
}
